package com.zzyl.redis;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootTest
public class testString {
    @Autowired
    private RedisTemplate<String,String> redisTemplate;

    @Test
    public void testHash(){
    redisTemplate.opsForHash().put("user","name","zhangsan");
    redisTemplate.opsForHash().put("user","age","20");
    redisTemplate.opsForHash().put("user","sex","男");
        System.out.println(redisTemplate.opsForHash().get("user", "name"));

    }
}
